<?php
	class ModelSupportNeeds extends Model{
		public function getNeedsByCategory($category, $all){
			$sql = "SELECT * FROM " . DB_PREFIX . "Needs WHERE category_id = $category";
			
			if ($all == '1'){
				$sql .= " or category_id = 0";
			}
			
			$result = $this->db->query($sql);
			
			return $result->rows;
		}
	}
?>